home *** CD-ROM | disk | FTP | other *** search
- /*
- File: UseRsrcM.h
-
- Contains: Functions for using resources from the resource fork of a library
-
- Owned by: Jens Alfke
-
- Copyright: © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
-
- Theory of Operation:
-
- This utility provides convenient access to a part editor's (or other shared
- library's) resources -- a library's resource fork is _not_ by default open
- or accessible. Please see the OpenDoc tech note "Using Resources" for full
- instructions.
-
- In Progress:
-
- */
-
-
- #ifndef _USERSRCM_
- #define _USERSRCM_
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- #ifndef _EXCEPT_
- #include "Except.h"
- #endif
-
- #ifndef __CODEFRAGMENTS__
- #include <CodeFragments.h>
- #endif
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- OSErr InitLibraryResources( CFragInitBlockPtr );
-
- void CloseLibraryResources( );
-
-
- ODSLong BeginUsingLibraryResources( );
- void EndUsingLibraryResources( ODSLong );
-
-
- ODHandle ODReadResource( ResType type, short id );
- ODHandle ODReadNamedResource( ResType type, ConstStr255Param name );
-
- ODPtr ODReadResourceToPtr( ResType type, short id );
- ODPtr ODReadNamedResourceToPtr( ResType type, ConstStr255Param name );
-
- void ODGetString( Str255 str, short id );
- void ODGetIndString( Str255 str, short id, short index );
-
-
- #ifdef __cplusplus
- } // ends extern "C"
-
- class CUsingLibraryResources :private Destructo {
- public:
- CUsingLibraryResources( ) {fRefNum=BeginUsingLibraryResources();}
- ~CUsingLibraryResources( );
- private:
- ODSLong fRefNum;
- };
-
- inline void BeginUsingLibraryResources( ODSLong &ref ) // param is for backward compatibility
- {ref=BeginUsingLibraryResources();}
- #endif
-
-
- #endif /* _USERSRCM_ */